package com.hujia.hjsurprisemeal.repository;


import com.hujia.hjsurprisemeal.service.DishService;
import com.hujia.hjsurprisemeal.service.PricingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PricingServiceImpl implements PricingService {

    @Autowired
    private DishService dishService;

    @Override
    public Double calculateTotalPrice(List<Integer> dishIds) {
        return dishIds.stream()
                .mapToDouble(dishId -> dishService.getPrice(dishId))
                .sum();
    }

    @Override
    public double getPrice(Integer dishId) {
        return 0;
    }
}
